package ai.people.netmon.warning.service.impl;

import ai.people.netmon.framework.domain.warning.entity.WarningAccountLabelRelation;
import ai.people.netmon.framework.exception.enums.CommonEnum;
import ai.people.netmon.framework.utils.AssertUtils;
import ai.people.netmon.warning.mapper.WarningAccountLabelMapper;
import ai.people.netmon.warning.service.WarningAccountLabelService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 警告标签服务impl
 *
 * @author yuanqinglong
 * @date 2022/8/10 18:50
 */
@Service
@RequiredArgsConstructor
public class WarningAccountLabelServiceImpl extends ServiceImpl<WarningAccountLabelMapper, WarningAccountLabelRelation> implements WarningAccountLabelService {


    private final WarningAccountLabelMapper warningAccountLabelMapper;


    /**
     * 添加批量帐户标签
     *
     * @param warningAccountLabels 账户警告标签
     */
    @Override
    public void addBatchAccountLabel(List<WarningAccountLabelRelation> warningAccountLabels) {
        boolean saveBatch = this.saveBatch(warningAccountLabels);
        AssertUtils.isTrue(saveBatch, CommonEnum.FAIL);
    }

    /**
     * 通过账户查询标签
     *
     * @param accountIds 帐户id
     * @return {@link List}<{@link WarningAccountLabelRelation}>
     */
    @Override
    public List<WarningAccountLabelRelation> queryLabelByAccount(List<Long> accountIds) {
        return null;
    }
}
